<!DOCTYPE html>
<html>
	<head>
		<meta charset="UTF-8">
		<meta name="viewport" content="width=device-width,initial-scale=1,minimum-scale=1,maximum-scale=1,user-scalable=no" />
		<title></title>
		<link rel="stylesheet" type="text/css" href="../../../resource/css/bootstrap.min.css"/>
		<link rel="stylesheet" type="text/css" href="../../../resource/css/jedate.css"/>
		<link rel="stylesheet" type="text/css" href="../../../resource/fonts/iconfont.css"/>
		<link rel="stylesheet" type="text/css" href="../../../resource/css/common.css"/>
		<link rel="stylesheet" type="text/css" href="../../../../resources/layui/css/layui.css"/>

		<style type="text/css">
			/*.erp-txt span{width: 100px;}*/
		</style>
	</head>
	<body>
		<div class="container-fluid">
			<div class="row mheader">
				<div class="col-xs-2 text-left"><a href="javascript:;" onclick="location.href='../../../word.html'"><span class="iconfont icon-fanhui"></span></a></div>
				<div class="col-xs-8"><h2>合同进度查询</h2></div>
				<div class="col-xs-2 text-right"><a href="#"><span class="iconfont icon-31sousuo sousuo"></span></a></div>
			</div>
			<div class="row">
				<dl class="erp-list">

				</dl>
				<div class="showlists">暂无更多数据</div>

			</div>
			<!--搜索-->
			<div class="search-box">
				<div class="search-cover">
					<form action="" method="post">
						<div class="row">
							<div class="col-xs-4">
								<ul class="list-group list-items">
								  <li class="list-group-item list-group-lists search-active">项目名称</li>
								  <li class="list-group-item list-group-lists">开始时间</li>
								  <li class="list-group-item list-group-lists">结束时间</li>
								</ul>
							</div>
							<div class="col-xs-8">
								<div class="search-lists search-list1 search-active">
									<input type="text" class="pro pro-input pro-name" placeholder="项目名称"/>
								</div>
								<div class="search-lists search-list2 search-active">
									<input type="text" class="layui-input" id="gtime" name="begintime" placeholder="请输入开始时间">
								</div>
								<div class="search-lists search-list3 search-active">
									<input type="text" class="layui-input" id="gtime1" name="endtime" placeholder="请输入结束时间">
								</div>
							</div>
						</div>
						<div class="row">
							<span class="btns close-cover">取消</span>
							<input class="sub-cover btns fr" type="button" value="确定"/>
							
						</div>
						
					</form>
				
				</div>
			</div>
		</div>
	</body>
</html>
<script src="https://cdn.bootcss.com/jquery/2.2.4/jquery.min.js"></script>
<script src="../../../resource/js/bootstrap.min.js" type="text/javascript" charset="utf-8"></script>
<script src="../../../resource/js/jquery.jedate.js" type="text/javascript" charset="utf-8"></script>
<script src="../../../resource/js/style.js" type="text/javascript" charset="utf-8"></script>
<script src="../../../../resources/layui/layui.js"></script>

<script>

    layui.use(['form', 'layedit', 'laydate','table','laytpl','flow'], function() {
        var laydate = layui.laydate;

        laydate.render({
            elem: '#gtime'
            ,type: 'datetime'
        });
        laydate.render({
            elem: '#gtime1'
            ,type: 'datetime'
        });
    })


	$(".sousuo").click(function(){
		$(".search-box").slideToggle();
	})
	$(".list-group-lists").click(function(){
		var i=$(this).index();
		$(".search-lists").hide();
		$(".search-lists").eq(i).show();
		$(".list-group-lists").removeClass("search-active");
		$(this).addClass("search-active");
		$(".pros").hide();
		$(".pros").eq(i).show();

	});

	$(function () {
        var formData = {
            type:'a',
            proName:$('#test00').val(),
            begintime:$('#test01').val(),
            endtime:$('#test02').val(),
        };
        //滚动加载
        var nloader = LoadMore({
            api: 'api/contract/builConProcessList.do',
            data: formData,
            success: function (data) {
                console.log(data)
                sessionStorage.xiala=JSON.stringify(data.fullDown.contracts);
                console.log(sessionStorage.xiala)
                var datas=data.data;
                if(datas.length<=0){
                    $('.showlists').show();
                }else{
                    $('.showlists').hide();
                }
                for(var i=0;i<datas.length;i++){
                    switch (datas[i].cc_vali){
                        case 1:
                            datas[i].cc_vali='等待送回';
                            break;
                        case 0:
                            datas[i].cc_vali='已送达';
                            break;
                    };

                    datas[i].cc_valis = datas[i].cc_valis==-1?"等待确认":"已确认";

                    $('.erp-list').append('<dd>' +
                        '<a href="erp-details.html" uids="'+datas[i].cc_UUID+'">' +
                        '<h3>'+datas[i].cc_Code+'<span class="btn btn-danger fr">'+datas[i].cc_valis+'</span><span class="btn btn-danger fr">'+datas[i].cc_vali+'</span></h3>' +
                        '<div class="erp-txt visa-txt">' +
                        '<p class="clearfix"><span class="sp">项目名称:</span><span class="divCon">'+datas[i].proName+'</p></span>' +
                        '<p class="clearfix"><span class="sp">施工单位:</span><span class="divCon">'+datas[i].compName1+'</p></span>' +
                        '<p><span>申请时间:</span>'+datas[i].createTime+'</p>' +
                        '</div>' +
                        '</a>' +
                        '</dd>')
                }
            }
        })

//	点击取消按钮
        $(".close-cover").click(function(){
            $(".search-box").slideUp();
        });
//	点击确定按钮
        $(".sub-cover").click(function(){
            console.log($(".pro-name").val());
            console.log($("#test01").val());
            console.log($("#test02").val());
            $('.erp-list').html('');
            $(".search-box").slideUp();
            formData.proName=$(".pro-name").val();
            formData.begintime=$('#gtime').val();
            formData.endtime=$('#gtime1').val();
            nloader.search();
        });


        $('.erp-list').on('click','a',function () {
            sessionStorage.uuid=$(this).attr('uids');
        });

    })
</script>










